home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3n / accept.z / accept
Encoding:
Text File  |  2002-10-03  |  7.4 KB  |  133 lines

  1.  
  2.  
  3.  
  4. aaaacccccccceeeepppptttt((((3333NNNN))))                                                          aaaacccccccceeeepppptttt((((3333NNNN))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _aaaa_cccc_cccc_eeee_pppp_tttt - accept a connection on a socket
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.  
  14.      _iiii_nnnn_tttt _aaaa_cccc_cccc_eeee_pppp_tttt_((((_iiii_nnnn_tttt _ssss_,,,, _cccc_aaaa_dddd_dddd_rrrr______tttt _aaaa_dddd_dddd_rrrr_,,,, _iiii_nnnn_tttt _****_aaaa_dddd_dddd_rrrr_llll_eeee_nnnn_))))_;;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      The argument _s is a socket that has been created with _ssss_oooo_cccc_kkkk_eeee_tttt and bound to
  18.      an address with _bbbb_iiii_nnnn_dddd, and that is listening for connections after a call
  19.      to _llll_iiii_ssss_tttt_eeee_nnnn.  _aaaa_cccc_cccc_eeee_pppp_tttt extracts the first connection on the queue of pending
  20.      connections, creates a new socket with the properties of _s, and allocates
  21.      a new file descriptor, _n_s, for the socket.  If no pending connections are
  22.      present on the queue and the socket is not marked as non-blocking, _aaaa_cccc_cccc_eeee_pppp_tttt
  23.      blocks the caller until a connection is present.  If the socket is marked
  24.      as non-blocking and no pending connections are present on the queue,
  25.      _aaaa_cccc_cccc_eeee_pppp_tttt returns an error as described below.  _aaaa_cccc_cccc_eeee_pppp_tttt uses the _nnnn_eeee_tttt_cccc_oooo_nnnn_ffff_iiii_gggg
  26.      file to determine the STREAMS device file name associated with _s.  This
  27.      is the device on which the connect indication will be accepted.  The
  28.      accepted socket, _n_s, is used to read and write data to and from the
  29.      socket that connected to _n_s; it is not used to accept more connections.
  30.      The original socket (_s) remains open for accepting further connections.
  31.  
  32.      The argument _a_d_d_r is a result parameter that is filled in with the
  33.      address of the connecting entity as it is known to the communications
  34.      layer.  The exact format of the _a_d_d_r parameter is determined by the
  35.      domain in which the communication occurs.
  36.  
  37.      _a_d_d_r_l_e_n is a value-result parameter.  Initially, it contains the amount
  38.      of space pointed to by _a_d_d_r; on return it contains the length in bytes of
  39.      the address returned.
  40.  
  41.      _aaaa_cccc_cccc_eeee_pppp_tttt is used with connection-based socket types, currently with
  42.      _SSSS_OOOO_CCCC_KKKK______SSSS_TTTT_RRRR_EEEE_AAAA_MMMM.
  43.  
  44.      It is possible to _ssss_eeee_llll_eeee_cccc_tttt a socket for the purpose of an _aaaa_cccc_cccc_eeee_pppp_tttt by
  45.      selecting it for read.  However, this will only indicate when a connect
  46.      indication is pending; it is still necessary to call _aaaa_cccc_cccc_eeee_pppp_tttt.
  47.  
  48. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
  49.      _aaaa_cccc_cccc_eeee_pppp_tttt returns -1 on error.  If it succeeds, it returns a non-negative
  50.      integer that is a descriptor for the accepted socket.
  51.  
  52. EEEERRRRRRRROOOORRRRSSSS
  53.      _aaaa_cccc_cccc_eeee_pppp_tttt will fail if:
  54.  
  55.      _EEEE_BBBB_AAAA_DDDD_FFFF               The descriptor is invalid.
  56.  
  57.      _EEEE_NNNN_OOOO_TTTT_SSSS_OOOO_CCCC_KKKK            The descriptor does not reference a socket.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. aaaacccccccceeeepppptttt((((3333NNNN))))                                                          aaaacccccccceeeepppptttt((((3333NNNN))))
  71.  
  72.  
  73.  
  74.      _EEEE_OOOO_PPPP_NNNN_OOOO_TTTT_SSSS_UUUU_PPPP_PPPP          The referenced socket is not of type _SSSS_OOOO_CCCC_KKKK______SSSS_TTTT_RRRR_EEEE_AAAA_MMMM.
  75.  
  76.      _EEEE_WWWW_OOOO_UUUU_LLLL_DDDD_BBBB_LLLL_OOOO_CCCC_KKKK         The socket is marked as non-blocking and no
  77.                          connections are present to be accepted.
  78.  
  79.      _EEEE_PPPP_RRRR_OOOO_TTTT_OOOO              A protocol error has occurred; for example, the
  80.                          STREAMS protocol stack has not been initialized.
  81.  
  82.      _EEEE_NNNN_OOOO_DDDD_EEEE_VVVV              The protocol family and type corresponding to _s could
  83.                          not be found in the _nnnn_eeee_tttt_cccc_oooo_nnnn_ffff_iiii_gggg file.
  84.  
  85.      _EEEE_NNNN_OOOO_MMMM_EEEE_MMMM              There was insufficient user memory available to
  86.                          complete the operation.
  87.  
  88.      _EEEE_NNNN_OOOO_SSSS_RRRR               There were insufficient STREAMS resources available
  89.                          to complete the operation.
  90.  
  91. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  92.      _bbbb_iiii_nnnn_dddd(3N), _cccc_oooo_nnnn_nnnn_eeee_cccc_tttt(3N), _llll_iiii_ssss_tttt_eeee_nnnn(3N), _ssss_oooo_cccc_kkkk_eeee_tttt(3N), _nnnn_eeee_tttt_cccc_oooo_nnnn_ffff_iiii_gggg(4).
  93.  
  94. NNNNOOOOTTTTEEEESSSS
  95.      The type of address structure passed to _aaaa_cccc_cccc_eeee_pppp_tttt depends on the address
  96.      family.  UNIX domain sockets (address family _AAAA_FFFF______UUUU_NNNN_IIII_XXXX) require a
  97.      _ssss_oooo_cccc_kkkk_eeee_tttt_aaaa_dddd_dddd_rrrr______uuuu_nnnn structure as defined in _ssss_yyyy_ssss_////_uuuu_nnnn_...._hhhh; Internet domain sockets
  98.      (address family _AAAA_FFFF______IIII_NNNN_EEEE_TTTT) require a _ssss_oooo_cccc_kkkk_aaaa_dddd_dddd_rrrr______iiii_nnnn structure as defined in
  99.      _nnnn_eeee_tttt_iiii_nnnn_eeee_tttt_////_iiii_nnnn_...._hhhh.  Other address families may require other structures.  Use
  100.      the structure appropriate to the address family; cast the structure
  101.      address to a generic _cccc_aaaa_dddd_dddd_rrrr______tttt in the call to _aaaa_cccc_cccc_eeee_pppp_tttt and pass the size of
  102.      the structure in the _a_d_d_r_l_e_n argument.
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.